// mock数据模拟
import Mock from "mockjs";
// 图表数据
let List = []

export default {
  getStatistcalData: () => {
    // Mock.Random.float 产生随机数100到8000之间 保留小数 最小0位 最大0位
    for (let i = 0; i < 7; i++) {
      List.push(
        Mock.mock({
          苹果: Mock.Random.float(100, 8000, 0, 0),
          vivo: Mock.Random.float(100, 8000, 0, 0),
          oppo: Mock.Random.float(100, 8000, 0, 0),
          魅族: Mock.Random.float(100, 8000, 0, 0),
          三星: Mock.Random.float(100, 8000, 0, 0),
          小米: Mock.Random.float(100, 8000, 0, 0),
        })
      )
    }
    return {
      code: 20000,
      data: {
        //饼图
        videoData: [
          {
            name: '小米',
            value: 2999

          },
          {
            name: '苹果',
            value: 5999

          },
          {
            name: 'vivo',
            value: 1500

          },
          {
            name: 'oppo',
            value: 4999

          },
          {
            name: '魅族',
            value: 2200

          },
          {
            name: '三星',
            value: 4500
          }
        ],
        // 柱状图
        userData: [
          {
            date: '周一',
            new: 5,
            active: 200
          },
          {
            date: '周二',
            new: 15,
            active: 400
          },
          {
            date: '周三',
            new: 25,
            active: 600
          },
          {
            date: '周四',
            new: 35,
            active: 800
          },
          {
            date: '周五',
            new: 45,
            active: 1000
          }
        ],
        // 折线图
        orderData: {
            date: ['20230302', '20230304', '20230305', '20230306', '20230307', '20230308', '20230309'],
            data: List
          },
        tableData: [
          {
            name: 'oppo',
            todayBuy: 500,
            monthBuy: 3500,
            totalBuy: 22000
          },
          {
            name: 'oppo',
            todayBuy: 600,
            monthBuy: 3500,
            totalBuy: 22000
          },
          {
            name: 'oppo',
            todayBuy: 700,
            monthBuy: 3500,
            totalBuy: 22000
          },
          {
            name: 'oppo',
            todayBuy: 800,
            monthBuy: 3500,
            totalBuy: 22000
          },{
            name: 'oppo',
            todayBuy: 900,
            monthBuy: 3500,
            totalBuy: 22000
          },
          {
            name: 'oppo',
            todayBuy: 1000,
            monthBuy: 3500,
            totalBuy: 22000
          }
        ]
      }
    }
  }
}